<?php

namespace App\Levels;

use App\Enums\UserType;

class LevelFactory
{
    private $levelMap;

    public function __construct()
    {
        $this->levelMap = [
            UserType::Boss->value => BossLevel::class,
            UserType::FrontManager->value => FrontManagerLevel::class,
            UserType::AssistantManager->value => AssistantManagerLevel::class,
            UserType::Assistant->value => AssistantLevel::class,
            UserType::Coach->value => CoachLevel::class,
            UserType::Waiter->value => WaiterLevel::class,
            UserType::Cashier->value => CashierLevel::class,
        ];
    }

    public function createLevel(UserType $type)
    {
        return new $this->levelMap[$type->value]();
    }
}
